# Maintainer: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=link-grammar
pkgver=5.8.0
pkgrel=3
pkgdesc="A Grammar Checking library"
arch=('x86_64')
url="https://www.abisource.com/projects/link-grammar/"
license=('LGPL')
depends=('hunspell' 'sqlite' 'libedit')
makedepends=('python' 'swig' 'apache-ant' 'java-environment=11')
options=('!makeflags')
source=(https://www.abisource.com/downloads/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.gz{,.asc})
validpgpkeys=('6407453C98BECC19ADB03D82EB6AA534E0C0651C')
sha256sums=('ad65a6b47ca0665b814430a5a8ff4de51f4805f7fb76642ced90297b4e7f16ed'
            'SKIP')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  ./configure --prefix=/usr

  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  make DESTDIR="${pkgdir}" install
}
